package yns.springboot.guide.demo.service.jdbc.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import yns.springboot.guide.demo.data.db.jdbc.dao.UserDaoJDBC;
import yns.springboot.guide.demo.entity.UserEntity;
import yns.springboot.guide.demo.service.jdbc.UserServiceJDBC;

@Service
public class UserServiceJDBCImpl implements UserServiceJDBC {

	@Autowired
	private UserDaoJDBC userDaoJDBC;
	
	public List<UserEntity> getUser(){
		return userDaoJDBC.getUser();
	}

	@Override
	public void addUser(UserEntity userEntity) {
		userDaoJDBC.addUser(userEntity);
		
	}

	@Override
	public void deleteUser(int id) {
		userDaoJDBC.deleteUser(id);
		
	}

	@Override
	public void updateUser(UserEntity userEntity) {
		userDaoJDBC.updateUser(userEntity);
		
	}
}
